package com.mallcloud.mall.app.api.entity.vo;

import cn.hutool.core.util.XmlUtil;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

/**
 * 微信支付 API V2
 */
@Slf4j
@UtilityClass
public class WechatPayV2Response {

    public static String success() {
        Map res = new HashMap();
        res.put("return_code", "SUCCESS");
        res.put("return_msg", "OK");
        return XmlUtil.mapToXmlStr(res, true);
    }

    public static String fail() {
        return fail("失败");
    }

    public static String fail(String msg) {
        Map res = new HashMap();
        res.put("return_code", "FAIL");
        res.put("return_msg", msg);
        return XmlUtil.mapToXmlStr(res, true);
    }
}
